<?php

session_start();

require "include/template2.inc.php";
require "include/beContent.inc.php";

require "include/auth.inc.php";

$main = new Skin(); 

$form = new Form("dataEntry",$pageEntity);

$form->addSection("Page Management");

$form->addText("title_it", "Title (it)", 60);
$form->addText("title_en", "Title (en)", 60);
$form->addText("subtitle_it", "Subtitle (it)", 60);
$form->addText("subtitle_en", "Subtitle (en)", 60);

$form->addSelectFromReference2($sectionEntity, "section", "Section");
$form->addHierarchicalPosition("position", "Page Order", "title_it", "section");



$form->addEditor("body_it", "Content (it)",20,50); 
$form->addEditor("body_en", "Content (en)",20,50); 

$form->addFile("foto", "Foto");
$form->addText("link", "Link", 60);


if (!isset($_REQUEST['action'])) {
	$_REQUEST['action'] = "edit";
}
switch($_REQUEST['action']) {
	case "add":
	$main->setContent("body",$form->addItem());
	break;
	case "edit":
	$main->setContent("body",$form->editItem());
	break;
}

$main->close();

?>